<template>
<div id="app">
    <hr style="border: none"/>
    <div>
        <el-form :inline="true" :model="queryForm.data" class="demo-form-inline">
            <el-form-item>
                <el-select v-model="queryForm.data.collegeCode" clearable placeholder="请选择学院">
                    <el-option
                            v-for="item in options.collegeCode"
                            :key="item.id"
                            :label="item.text"
                            :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-date-picker
                        v-model="queryForm.data.year"
                        type="year"
                        placeholder="选择年份"
                        value-format="yyyy">
                </el-date-picker>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="loadEcharts" icon="el-icon-search">查询</el-button>
            </el-form-item>
        </el-form>
    </div>
    <div align="center">
        <span style="font-family: 微软雅黑;font-size: 20px;">潍坊学院{{this.queryForm.data.year}}年度</span>

        <br/>
        <span style="font-size: 18px">学生报道情况</span>
    </div>
    <hr>

    <div style="height:2800px;">
        <el-row :gutter="10" class="recruitRow">
            <el-col :span="24" class="recruitCol">
                <el-card :body-style="{ padding: '0px',height: '80%' }">
                    <div slot="header" class="clearfix">
                        <span>横向对比-学院对比</span>
                    </div>
                    <college-recruit v-bind:year="this.queryForm.data.year" class="echarts"></college-recruit>
                </el-card>
            </el-col>
        </el-row>
        <el-row :gutter="10" class="recruitRow">
            <el-col :span="24" class="recruitCol">
                <el-card :body-style="{ padding: '0px',height: '80%' }">
                    <div slot="header" class="clearfix">
                        <span>横向对比-专业对比</span>
                    </div>
                    <major-recruit v-bind:year="this.queryForm.data.year"
                        v-bind:collegeCode="this.queryForm.data.collegeCode"
                        class="echarts"></major-recruit>
                </el-card>
            </el-col>
        </el-row>
        <!-- <el-row :gutter="10">
            <el-col :span="6" style="width: 100%;">
                <el-card :body-style="{ padding: '0px',height: '80%' }">
                    <div slot="header" class="clearfix">
                        <span>潍坊学院整体报到情况变化趋势</span>
                    </div>
                    <schollr-recruit-trend class="echarts"></schollr-recruit-trend>
                </el-card>
            </el-col>
        </el-row>         -->
    </div>
  </div>


</template>

<script>

import CollegeRecruit from "./college-recruit.vue";
import MajorRecruit from "./major-recruit.vue";
import SchoolRecruitTrend from "./school-trend.vue";

export default {
  name: "Total",
  components: {
    "college-recruit": CollegeRecruit,
    "major-recruit": MajorRecruit,
    "schollr-recruit-trend": SchoolRecruitTrend
  },
  data() {
    return {
      url: {
        collegeOptions: "/datacenter/college/query/spinner"
      },
      queryForm: {
        dialogFormVisible: false,
        data: {
          //学院代码
          collegeCode: "",
          // 年份
          year: new Date().getFullYear().toString()
        }
      },
      options: {
        collegeCode: []
      }
    };
  },
  methods: {
    loadEcharts: function() {}
  },
  mounted: function() {
    //初始化操作
    this.$http.get(this.url.collegeOptions).then(
      (res) => {
        console.log(this.queryForm.data.year);
        if (res.data.success) {
          this.options.collegeCode = res.data.data;
        } else {
          this.$message({
            type: "error",
            message: res.data.info
          });
        }
      },
      (res) => {
        this.$message({
          showClose: true,
          message: "网络错误,code=" + res.status,
          type: "error"
        });
      }
    );
  }
};
</script>
<style>
.el-card {
  height: 100%;
}

.time {
  font-size: 13px;
  color: #999;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 100%;
  display: block;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both;
}

.recruitRow {
  width: 100%;
  height: 30%;
  margin-bottom: 10px;
}

.recruitCol {
  width: 100%;
  height: 100%;
}

.echarts {
  width: 100%;
  height: 100%;
}
</style>
